#ifndef TRI_UI_WIDGETS_FILEBROWSER_H_
#define TRI_UI_WIDGETS_FILEBROWSER_H_

#include "scrollpanel.h"
#include "popup.h"
#include "button.h"
#include "itemlist.h"
#include "textedit.h"
#include "uistyle.h"

namespace tri{
namespace ui{

class FileSystemBrower : public tri::ui::extPopup, public sigslot::has_slots<sigslot::multi_threaded_local>{
public:
	FileSystemBrower();
	virtual ~FileSystemBrower();
	void reset();
	void moveUpOneLevel();
	void setDirectory(std::string dir);
	void onItemClicked(tri::ui::extItemList* list);
	void updateFileList();
	virtual void onOk();
	virtual void onCancel();
	std::string getDirectory();
	std::string getFile();
	std::string getFullFilePath();
	void setFilterExtension(std::string str);
	
	tri::ui::extTextEdit mDirectoryNameEdit;
	tri::ui::extTextEdit mFileNameEdit;
	tri::ui::extScrollPanel mFilePanelScrollBox;
	tri::ui::extItemList mFileListPanel;
	tri::ui::extButton mOkButton;
	tri::ui::extButton mCancelButton;
	tri::ui::extButton mUpOneLevelButton;
	tri::ui::extPanel mBackPanel;
	
	
		
private:
	std::string mCurDir;
	bool mDirChanged;
	void setup();
	std::string mFilterExtension;
};

}
}

#endif /*STYLES_H_*/
